﻿using System;
using System.Configuration;
using System.Web;
using System.Xml;

namespace CreativeMinds.Umbraco.Installation {
	public class WebConfig {
		private XmlDocument xml;
		private static WebConfig instance = null;

		public static WebConfig Instance {
			get {
				if (instance == null) {
					instance = new WebConfig(HttpContext.Current.Server.MapPath("/web.config"));
				}
				return instance;
			}
		}

		private WebConfig(string path) {
			xml = new XmlDocument();
			xml.Load(path);
		}

		public string RootPath {
			get {
				return ConfigurationManager.AppSettings["umbracoPath"];
			}
		}

		public string ConnectString {
			get {
				return ConfigurationManager.AppSettings["umbracoDbDSN"];
			}
		}
	}
}